import os
import random
from tasks import pre_pocess

home = os.getenv('HOME', '')
out_dir = home + '/data/out/simple_classification'
db_root = home + '/data/grade/train'


file = open(home + '/data/grade/trainLabels.csv' )
lines = file.read().splitlines()
random.shuffle(lines)
file.close()

queue = []
for line in lines[1:]:
    line_split = line.split(',')
    img_name = db_root + '/' + line_split[0] + '.jpeg'
    queue.append(pre_pocess.delay(img_name))
    while len(queue) > 20:
        for x in queue:
            if x.ready():


